/**
 * @ Author: luoqi
 * @ Create Time: 2024-07-11 18:28
 * @ Modified by: luoqi
 * @ Modified time: 2024-10-12 22:10
 * @ Description:
 */

#ifndef _BSP_H
#define _BSP_H

#include <stdint.h>

#include "../Core/Inc/main.h"
#include "../Core/Inc/usart.h"
#include "../Core/Inc/gpio.h"
#include "../Core/Inc/tim.h"

typedef enum {
    BSP_LED_OFF = 0,
    BSP_LED_ON = 1,
} BspLedState;

int bsp_init(void);

int bsp_deinit(void);

void bsp_led_set(BspLedState state);

void bsp_blink_set(uint32_t lfrq, uint32_t hfrq);

int bsp_uart1_recv(uint8_t *data, uint32_t len, uint32_t timeout);

int bsp_uart1_send(const uint8_t *data, uint32_t sz, uint32_t timeout);

int bsp_printf(const char *fmt, ...);

void bsp_mdelay(uint32_t ms);

void bsp_reboot(void);

uint32_t bsp_strlen(const char *s);

#endif
